[NET] back: Add lazy copying
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 30 May 2007 09:47:05 +0000 (10:47 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 30 May 2007 09:47:05 +0000 (10:47 +0100)
commit96469475a6848763fd542d1305660ee7a8561569
treec7350bc87e0a8c605f501d1f7b437336642a3ba5
parent403542f9101ebfcb45a881d6be9e8543059e409f
[NET] back: Add lazy copying

This patch adds lazy copying using the new unmap_and_replace grant
table operation.

We keep a list of pending entries sorted by arrival order.  We'll
process this list every time net_tx_action is invoked.  We ensure
that net_tx_action is invoked within one second of the arrival of
the first packet in the list.

When we process the list any entry that has been around for more
than half a second is copied.  This allows up to free the grant
table entry and return it to domU.

If the new grant table operation is not available (e.g., old HV
or architectures that don't support it yet) we simply copy each
packet as we receive them using skb_linearize.  We also disable
SG/TSO if this is the case.

By default the new code is disabled.  In order to enable it,
the module needs to be loaded with the argument copy_skb=1.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
linux-2.6-xen-sparse/drivers/xen/netback/common.h
linux-2.6-xen-sparse/drivers/xen/netback/netback.c
linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c